/**
 * @ author: 汪孟苹
 */
define(['jquery','template','bch/app/selfRecord/pregnancySelfRecord.servers','bch/template/selfRecord/pregnancySelfRecord.tpl'],function($,template,$servers,tpl){
	var ui = {};

	var drawInfo = function(data){
		return template("pregnancySelfRecord_info",data);
	}
	var drawBmiTable = function(data){
		return template("pregnancySelfRecord_bmiTable",data);
	}
	var drawFmTable = function(data){
		return template("pregnancySelfRecord_fmTable",data);
	}
	var drawCourseTable = function(data){
		return template("pregnancySelfRecord_courseTable",data);
	}

	ui.info = function(options){
		$("#" + options.id).html(tpl.info());
		var h = drawInfo($servers.handleInfo(options.data));
		$("#" + options.id).html(h);
	}
	ui.bmiTable = function(options){
		$("#" + options.id).html(tpl.bmiTable());
		var h = drawBmiTable($servers.hanleBmiData(options.list));
		$("#" + options.id).html(h);
	}
	ui.fmTable = function(options){
		$("#" + options.id).html(tpl.fmTable());
		var h = drawFmTable($servers.hanleFmData(options.list));
		$("#" + options.id).html(h);
	}
	ui.courseTable = function(options){
		$("#" + options.id).html(tpl.courseTable());
		var h = drawCourseTable(options);
		$("#" + options.id).html(h);
	}

	return ui;
});